# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=corrosion
pkgver=0_git20210414
pkgrel=2
_commit="946c5dd80a6ebdb84c5986e52af460e23e74394d"
pkgdesc="Marrying Rust and CMake - Easy Rust and C/C++ Integration!"
url="https://github.com/AndrewGaspar/corrosion"
# s390x and riscv64 blocked by Rust
arch="all !s390x !riscv64"
license="MIT"
depends="
	cargo
	cmake
	rust
	"
source="https://github.com/AndrewGaspar/corrosion/archive/$_commit/corrosion-$_commit.tar.gz"
options="net" # Required to download Rust dependencies
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="1483fef5e3bce879b0f28c1f9f000baf10b1621d7427637d1ed968f62388e963f21cb7ac024fcd9f35e4f538ab4e2494ada13d4bed88de09e57e1551ad6cb6cb  corrosion-946c5dd80a6ebdb84c5986e52af460e23e74394d.tar.gz"
